﻿using AutoMapper;
using Ross.EntityFramework;
using Ross.EntityFramework.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ross.Service.AutoMapper
{
    public class EntityProfile : Profile
    {
        public EntityProfile()
        {
            CreateMap<Users, Dto.oUser>();
            CreateMap<Dto.oUser, Users>();

            CreateMap<Targets, Dto.MonthlyPlan>();
            CreateMap<Dto.MonthlyPlan, Targets>();
            
            CreateMap<Dto.TargetInput, Targets>();
            CreateMap<Dto.TargetTotal, Targets>();

            CreateMap<Targets, Dto.TargetOutput>();
            CreateMap<Dto.TargetOutput, Targets> ();

            CreateMap<Targets, Dto.TargetsInput>();
            CreateMap<Dto.TargetsInput, Targets>();

            CreateMap<Targets, Dto.TargetsOutput>();
            CreateMap<Dto.TargetsOutput, Targets>();


            CreateMap<Targets, Dto.BuMenBiaoOutput>();
            CreateMap<Dto.BuMenBiaoOutput, Targets>();

            CreateMap<Targets, Dto.BSCReports_Co>();
            CreateMap<History, Dto.BSCReports_Co>();
            CreateMap<Dto.BSCReports_Co, Dto.BSCReports_CoOut>();
            CreateMap<Targets, Dto.BSCReports_Dp>();
            CreateMap<History, Dto.BSCReports_Dp>();

            CreateMap<Targets, Dto.NewZongBiao>();//.ForMember(u => u.Timespan[0], options => options.MapFrom(input => input.StartingTime))
                //.ForMember(u => u.Timespan[1], options => options.MapFrom(input => input.PlannedCompletionTime))
                //.ForMember(u => u.Timespan, options => options.Ignore());
            CreateMap<Dto.NewZongBiao, Targets>();

            CreateMap<Dto.ZhanLueInput, Targets>();
            CreateMap<Targets, Dto.ZhanLueInput>();

            CreateMap<Dto.BuMenInput, Targets>();
            CreateMap<Targets, Dto.BuMenInput>();

            CreateMap<Dto.ShenHeBiao, Targets>();
            CreateMap<Targets, Dto.ShenHeBiao>();

            CreateMap<Dto.BuMenInput2, Targets>();
            CreateMap<Targets, Dto.BuMenInput2>().ForMember(u => u.Departments, options => options.Ignore());

            CreateMap<History, Targets>();
            CreateMap<Targets, History>();

        }
    }
}
